package com.qhg.saas_server.service.impl;


import com.qhg.saas_server.mapper.PrisystemDAO;
import com.qhg.saas_server.pojo.Prisystem;
import com.qhg.saas_server.service.PrisystemService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 *@作者:lsk
 *Service实现类
 *@Date:2023/07/18
*/
@Service
public class PrisystemServiceImpl implements PrisystemService {


	@Resource
	private PrisystemDAO prisystemdao;


	/**
	根据PriSystemId查询
	*/
	public Object selectByPriSystemId(Integer priSystemId){
		return prisystemdao.selectByPriSystemId(priSystemId);
	}


	/**
	根据PriSystemId更新
	*/
	public Integer updateByPriSystemId(Prisystem demo){
		return prisystemdao.updateByPriSystemId( demo);
	}



	/**
	根据PriSystemId删除
	*/
	public Integer deleteByPriSystemId(Integer priSystemId){
		return prisystemdao.deleteByPriSystemId(priSystemId);
	}





	/**
	 insert:(插入)
	*/
	public Object insert(Prisystem demo){
		prisystemdao.insert(demo);
		return demo;
	}



	/**
	 insertOrUpdate(插入或更新(根据主键或唯一索引更新，主键和唯一索引不会改变))
	*/
	public Integer insertOrUpdate(Prisystem demo){
		return prisystemdao.insertOrUpdate(demo);
	}



	/**
	 insertBath:(批量插入)
	*/
	public Integer insertBatch(List<Prisystem> list){
		return prisystemdao.insertBatch(list);
	}



	/**
	 insertOrUpdateBatch:(批量插入或更新)
	*/
	public Integer insertOrUpdateBatch(List<Prisystem> list){
		return prisystemdao.insertOrUpdateBatch(list);
	}



	/**
	 selectList:(根据参数查询集合)
	*/
	public List<Prisystem> selectList(Map<String,Object> param){
		if(param.get("pageNum") != null){
			int start = Integer.parseInt(param.get("pageSize").toString()) * (Integer.parseInt(param.get("pageNum").toString()) - 1);
			param.put("pageNum",start);
		}
		return prisystemdao.selectList(param);
	}



	/**
	 selectCount:(根据集合查询数量)
	*/
	public Long selectCount(Map<String,Object> param){
		return prisystemdao.selectCount(param);
	}



}